package com.care.manage.server.controller;

import com.care.common.core.domain.Result;
import com.care.doctor.common.domain.DTODepartment;
import com.care.doctor.common.domain.DTODoctor;
import com.care.doctor.common.domain.DTODoctorType;
import com.care.doctor.common.domain.DTOHospital;
import com.care.doctor.common.req.GetDoctorReq;
import com.care.doctor.common.req.ListReq;
import com.care.doctor.remote.DepartmentRemoteService;
import com.care.doctor.remote.DoctorRemoteService;
import com.care.doctor.remote.DoctorTypeRemoteService;
import com.care.doctor.remote.HospitalRemoteService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 靳家振
 * @Date: 2024/3/23 18:32
 * @Description:
 **/

@RestController
@RequestMapping("/manage")
public class ManageController {
    @Autowired
    private HospitalRemoteService hospitalRemoteService;
    @Autowired
    private DepartmentRemoteService departmentRemoteService;

    @Autowired
    private DoctorTypeRemoteService doctorTypeRemoteService;

    @Autowired
    private DoctorRemoteService doctorRemoteService;

    @PostMapping("/hospital/findHospital")
    public Result<PageInfo<DTOHospital>> findHospital(@RequestBody ListReq req) {
        Result<PageInfo<DTOHospital>> result = hospitalRemoteService.findHospital (req);
        return result;
    }


    @PostMapping("/department/findDepartment")
    public Result<PageInfo<DTODepartment>> findDepartment(@RequestBody ListReq req) {
        return departmentRemoteService.findDepartment (req);
    }

    @PostMapping("/doctorType/findDoctorType")
    public Result<PageInfo<DTODoctorType>> findDoctorType(@RequestBody ListReq req){
        return doctorTypeRemoteService.findDoctorType (req);
    }
    @PostMapping("/doctor/findDoctor")
    public Result<PageInfo<DTODoctor>> findDoctor(@RequestBody GetDoctorReq req) {
        return doctorRemoteService.findDoctor(req);
    }
}
